<template>
<!-- 上面滑动条部分 -->
    <div>
       <div id="slider" class="mui-slider">
				<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
					<div class="mui-scroll">
						<a class="mui-control-item mui-active" href="#item1mobile" data-wid="tab-top-subpage-1.html" v-for="item in photolist" :key='item.id'>
							{{item.title}}
						</a>
						
					</div>
				</div>

			</div>
    </div>
    <!-- 下面图片部分 -->
    
</template>
<script>
import { Toast } from "mint-ui";
import mui from '../../src/lib/mui/js/mui.min.js'
    export default{
        data(){
            return{
                photolist:[]
            }
        },
        created(){
            this.getphotolist();
        },
        mounted(){
            mui('.mui-scroll-wrapper').scroll({
                      deceleration: 0.0005 ,//flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
                      scrollX: true //是否横向滚动
            });
        },
        methods:{
         getphotolist(){
             this.$http
             .get('http://www.liulongbin.top:3005/api/getimgcategory')
             .then(result=>{
                  if (result.body.status == 0) {
                   this.photolist=result.body.message;
                   this.photolist.unshift({id:0,title:'全部'})
                  } else {
                    Toast("内容加载不出来");
                  }
             })
         }
        },
        
    }
</script>
<style>
    
</style>